package com.cdm.persistence;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * CdmContentUseId entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Embeddable
public class ContentUseId implements java.io.Serializable {

	// Fields

	private Long licenseId;
	private Long dcid;
	private Long spid;

	// Constructors

	/** default constructor */
	public ContentUseId() {
	}

	/** full constructor */
	public ContentUseId(Long licenseId, Long dcid, Long spid) {
		this.licenseId = licenseId;
		this.dcid = dcid;
		this.spid = spid;
	}

	// Property accessors

	@Column(name = "license_id", unique = false, nullable = false, insertable = true, updatable = true)
	public Long getLicenseId() {
		return this.licenseId;
	}

	public void setLicenseId(Long licenseId) {
		this.licenseId = licenseId;
	}

	@Column(name = "dcid", unique = false, nullable = false, insertable = true, updatable = true)
	public Long getDcid() {
		return this.dcid;
	}

	public void setDcid(Long dcid) {
		this.dcid = dcid;
	}

	@Column(name = "spid", unique = false, nullable = false, insertable = true, updatable = true)
	public Long getSpid() {
		return this.spid;
	}

	public void setSpid(Long spid) {
		this.spid = spid;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof ContentUseId))
			return false;
		ContentUseId castOther = (ContentUseId) other;

		return ((this.getLicenseId() == castOther.getLicenseId()) || (this.getLicenseId() != null && castOther.getLicenseId() != null && this
		        .getLicenseId().equals(castOther.getLicenseId())))
		        && ((this.getDcid() == castOther.getDcid()) || (this.getDcid() != null && castOther.getDcid() != null && this.getDcid()
		                .equals(castOther.getDcid())))
		        && ((this.getSpid() == castOther.getSpid()) || (this.getSpid() != null && castOther.getSpid() != null && this.getSpid()
		                .equals(castOther.getSpid())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result + (getLicenseId() == null ? 0 : this.getLicenseId().hashCode());
		result = 37 * result + (getDcid() == null ? 0 : this.getDcid().hashCode());
		result = 37 * result + (getSpid() == null ? 0 : this.getSpid().hashCode());
		return result;
	}

}